Skip to content

fix(client-utils): require chainId on ramp activity items - #9777

Merged
georgeweiler merged 5 commits into
mainfrom
feat/client-utils-required-ramp-chainid
Aug 4, 2026
Merged

fix(client-utils): require chainId on ramp activity items#9777
georgeweiler merged 5 commits into
mainfrom
feat/client-utils-required-ramp-chainid

Conversation

@georgeweiler

@georgeweiler georgeweiler commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Explanation

  • follow up from feat(client-utils): map ramps orders into the shared activity item shape #9650
  • rampBuy / rampSell were the only ActivityItem kinds with optional chainId, which softens chainId across the whole union for TypeScript consumers (notably MetaMask Extension Activity).
  • Optional chainId existed for precreated stubs / unparseable provider network strings. Those rows should be hidden instead, matching mobile's local mapRampOrder (returns null when chain cannot be resolved).

Changes

  • @metamask/client-utils: Make chainId required on ramp activity items; mapRampsOrder returns null when no CAIP chain can be resolved.
  • @metamask/ramps-controller: Require non-empty chainId on addPrecreatedOrder so checkout stubs always seed network before pending flips.

Client follow-ups

Manual Testing Steps

  1. Run yarn workspace @metamask/client-utils test --testPathPatterns=ramps-order-mapper --coverage=false
  2. Run yarn workspace @metamask/ramps-controller test --testPathPatterns=RampsController.test --testNamePattern=addPrecreatedOrder --coverage=false
  3. Confirm mapper still resolves Coinbase-style network: 'ethereum' via cryptoCurrency.chainId / assetId.

Changelog

Updated @metamask/client-utils and @metamask/ramps-controller changelogs under Unreleased (BREAKING).


Note

Medium Risk
Breaking API changes in two packages require Extension/Mobile upgrades; behavior change hides ramp rows that previously appeared without chain, which is intentional but affects activity lists.

Overview
Breaking: rampBuy / rampSell ActivityItem variants now require chainId like every other activity kind, so TypeScript consumers no longer treat chainId as optional on the whole union.

In @metamask/client-utils, mapRampsOrder resolves chain id up front and returns null when no CAIP-2 id can be derived (empty network, unparseable provider network strings without cryptoCurrency fallbacks, invalid assetId), instead of emitting rows with missing chainId. The ramp types drop the special optional-chainId intersection.

In @metamask/ramps-controller, addPrecreatedOrder requires a non-empty chainId (decimal, hex, or CAIP-2); whitespace-only values are ignored like invalid orderId, and stubs always set network.chainId from the caller so pending activity can map before API enrichment.

Reviewed by Cursor Bugbot for commit a795eb7. Bugbot is set up for automated code reviews on this repo. Configure here.

@georgeweiler
georgeweiler requested review from a team as code owners August 4, 2026 09:30
@georgeweiler

Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-previews

georgeweiler added a commit that referenced this pull request Aug 4, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
georgeweiler added a commit that referenced this pull request Aug 4, 2026
Use toStrictEqual in addPrecreatedOrder tests, merge Unreleased
Changed changelog sections, and regenerate messenger action types
after making chainId required.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Preview builds have been published. Learn how to use preview builds in other projects.

Expand for full list of packages and versions.
@metamask-previews/account-tree-controller@7.5.5-preview-0efc7ef01
@metamask-previews/accounts-controller@39.0.6-preview-0efc7ef01
@metamask-previews/address-book-controller@7.1.2-preview-0efc7ef01
@metamask-previews/ai-controllers@0.8.0-preview-0efc7ef01
@metamask-previews/analytics-controller@2.0.0-preview-0efc7ef01
@metamask-previews/analytics-data-regulation-controller@0.0.0-preview-0efc7ef01
@metamask-previews/announcement-controller@8.1.0-preview-0efc7ef01
@metamask-previews/app-metadata-controller@2.0.1-preview-0efc7ef01
@metamask-previews/approval-controller@9.0.2-preview-0efc7ef01
@metamask-previews/assets-controller@13.1.0-preview-0efc7ef01
@metamask-previews/assets-controllers@110.1.0-preview-0efc7ef01
@metamask-previews/authenticated-user-storage@3.0.1-preview-0efc7ef01
@metamask-previews/base-controller@9.1.0-preview-0efc7ef01
@metamask-previews/base-data-service@0.1.3-preview-0efc7ef01
@metamask-previews/bitcoin-regtest-up@1.0.0-preview-0efc7ef01
@metamask-previews/bridge-controller@78.0.3-preview-0efc7ef01
@metamask-previews/bridge-status-controller@74.6.1-preview-0efc7ef01
@metamask-previews/build-utils@3.0.4-preview-0efc7ef01
@metamask-previews/chain-agnostic-permission@1.7.0-preview-0efc7ef01
@metamask-previews/chomp-api-service@4.0.0-preview-0efc7ef01
@metamask-previews/claims-controller@0.5.3-preview-0efc7ef01
@metamask-previews/client-controller@1.0.1-preview-0efc7ef01
@metamask-previews/client-utils@1.6.0-preview-0efc7ef01
@metamask-previews/compliance-controller@2.1.0-preview-0efc7ef01
@metamask-previews/composable-controller@12.0.1-preview-0efc7ef01
@metamask-previews/config-registry-controller@2.0.0-preview-0efc7ef01
@metamask-previews/connectivity-controller@0.3.0-preview-0efc7ef01
@metamask-previews/controller-utils@12.3.0-preview-0efc7ef01
@metamask-previews/core-backend@8.1.0-preview-0efc7ef01
@metamask-previews/delegation-controller@3.0.2-preview-0efc7ef01
@metamask-previews/earn-controller@12.2.3-preview-0efc7ef01
@metamask-previews/eip-5792-middleware@3.0.5-preview-0efc7ef01
@metamask-previews/eip-7702-internal-rpc-middleware@0.1.1-preview-0efc7ef01
@metamask-previews/eip1193-permission-middleware@2.0.1-preview-0efc7ef01
@metamask-previews/ens-controller@19.1.6-preview-0efc7ef01
@metamask-previews/eth-block-tracker@15.0.1-preview-0efc7ef01
@metamask-previews/eth-json-rpc-middleware@24.0.0-preview-0efc7ef01
@metamask-previews/eth-json-rpc-provider@6.0.1-preview-0efc7ef01
@metamask-previews/foundryup@1.0.1-preview-0efc7ef01
@metamask-previews/gas-fee-controller@26.3.1-preview-0efc7ef01
@metamask-previews/gator-permissions-controller@5.0.1-preview-0efc7ef01
@metamask-previews/geolocation-controller@1.0.0-preview-0efc7ef01
@metamask-previews/java-tron-up@1.0.0-preview-0efc7ef01
@metamask-previews/json-rpc-engine@10.5.0-preview-0efc7ef01
@metamask-previews/json-rpc-middleware-stream@8.0.8-preview-0efc7ef01
@metamask-previews/keyring-controller@27.1.0-preview-0efc7ef01
@metamask-previews/local-node-utils@1.0.0-preview-0efc7ef01
@metamask-previews/logging-controller@8.0.2-preview-0efc7ef01
@metamask-previews/message-manager@14.1.2-preview-0efc7ef01
@metamask-previews/messenger@2.0.0-preview-0efc7ef01
@metamask-previews/messenger-cli@0.2.0-preview-0efc7ef01
@metamask-previews/money-account-api-data-service@0.4.0-preview-0efc7ef01
@metamask-previews/money-account-balance-service@2.4.1-preview-0efc7ef01
@metamask-previews/money-account-controller@0.3.3-preview-0efc7ef01
@metamask-previews/money-account-upgrade-controller@3.0.1-preview-0efc7ef01
@metamask-previews/money-account-utils@1.1.0-preview-0efc7ef01
@metamask-previews/multichain-account-service@13.0.0-preview-0efc7ef01
@metamask-previews/multichain-api-middleware@4.0.2-preview-0efc7ef01
@metamask-previews/multichain-network-controller@3.2.2-preview-0efc7ef01
@metamask-previews/multichain-transactions-controller@7.1.1-preview-0efc7ef01
@metamask-previews/name-controller@9.1.2-preview-0efc7ef01
@metamask-previews/network-connection-banner-controller@0.1.2-preview-0efc7ef01
@metamask-previews/network-controller@35.0.1-preview-0efc7ef01
@metamask-previews/network-enablement-controller@6.0.2-preview-0efc7ef01
@metamask-previews/notification-services-controller@26.0.0-preview-0efc7ef01
@metamask-previews/passkey-controller@3.0.0-preview-0efc7ef01
@metamask-previews/permission-controller@13.1.1-preview-0efc7ef01
@metamask-previews/permission-log-controller@5.1.0-preview-0efc7ef01
@metamask-previews/perps-controller@10.0.0-preview-0efc7ef01
@metamask-previews/phishing-controller@17.3.1-preview-0efc7ef01
@metamask-previews/platform-api-docs@0.0.0-preview-0efc7ef01
@metamask-previews/polling-controller@16.0.9-preview-0efc7ef01
@metamask-previews/preferences-controller@23.1.0-preview-0efc7ef01
@metamask-previews/profile-metrics-controller@4.0.2-preview-0efc7ef01
@metamask-previews/profile-sync-controller@28.3.0-preview-0efc7ef01
@metamask-previews/ramps-controller@18.0.1-preview-0efc7ef01
@metamask-previews/rate-limit-controller@7.0.1-preview-0efc7ef01
@metamask-previews/react-data-query@0.2.2-preview-0efc7ef01
@metamask-previews/remote-feature-flag-controller@5.0.0-preview-0efc7ef01
@metamask-previews/sample-controllers@5.0.4-preview-0efc7ef01
@metamask-previews/seedless-onboarding-controller@10.1.0-preview-0efc7ef01
@metamask-previews/selected-network-controller@26.1.6-preview-0efc7ef01
@metamask-previews/sentinel-api-service@1.0.0-preview-0efc7ef01
@metamask-previews/shield-controller@5.1.3-preview-0efc7ef01
@metamask-previews/signature-controller@39.2.9-preview-0efc7ef01
@metamask-previews/smart-transactions-controller@25.0.2-preview-0efc7ef01
@metamask-previews/snap-account-service@2.1.1-preview-0efc7ef01
@metamask-previews/social-controllers@2.7.0-preview-0efc7ef01
@metamask-previews/solana-test-validator-up@1.0.0-preview-0efc7ef01
@metamask-previews/stellar-quickstart-up@0.0.0-preview-0efc7ef01
@metamask-previews/storage-service@1.0.2-preview-0efc7ef01
@metamask-previews/subscription-controller@6.2.1-preview-0efc7ef01
@metamask-previews/transaction-controller@69.4.0-preview-0efc7ef01
@metamask-previews/transaction-pay-controller@26.2.0-preview-0efc7ef01
@metamask-previews/user-operation-controller@41.2.8-preview-0efc7ef01
@metamask-previews/wallet@9.0.0-preview-0efc7ef01
@metamask-previews/wallet-cli@0.0.0-preview-0efc7ef01

wenfix
wenfix previously approved these changes Aug 4, 2026
FrederikBolding
FrederikBolding previously approved these changes Aug 4, 2026
@FrederikBolding FrederikBolding mentioned this pull request Aug 4, 2026
4 tasks
n3ps
n3ps previously approved these changes Aug 4, 2026
@georgeweiler
georgeweiler added this pull request to the merge queue Aug 4, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 4, 2026
@georgeweiler
georgeweiler added this pull request to the merge queue Aug 4, 2026
georgeweiler and others added 4 commits August 4, 2026 07:06
Make rampBuy/rampSell ActivityItem.chainId required like every other
kind. mapRampsOrder returns null when no CAIP chain can be resolved,
matching mobile's existing hide-if-unresolved behavior.

Also require a non-empty chainId on RampsController.addPrecreatedOrder
so checkout stubs always seed network before pending flips.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Preview/release pipelines own the version bump; leave the breaking
change under Unreleased.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use toStrictEqual in addPrecreatedOrder tests, merge Unreleased
Changed changelog sections, and regenerate messenger action types
after making chainId required.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 4, 2026
Rebase onto main after Release/1172.0.0 moved prior Unreleased entries
into 19.0.0. Ensure the addPrecreatedOrder chainId BREAKING note stays
in Unreleased so merge-queue changelog validation passes.

Co-authored-by: Cursor <cursoragent@cursor.com>
@georgeweiler
georgeweiler dismissed stale reviews from n3ps, FrederikBolding, and wenfix via a795eb7 August 4, 2026 13:10
@georgeweiler
georgeweiler force-pushed the feat/client-utils-required-ramp-chainid branch from 87b5a39 to a795eb7 Compare August 4, 2026 13:10
@georgeweiler

Copy link
Copy Markdown
Contributor Author

Changelog fix for merge-queue

After rebasing onto main (post Release/1172.0.0), the #9777 addPrecreatedOrder chainId BREAKING note was duplicated: once under ## [Unreleased] (correct) and again under ## [19.0.0] (incorrect).

Removed the duplicate from ## [19.0.0] ### Changed so the entry remains only under ## [Unreleased] ### Changed, which should satisfy merge-queue changelog validation.

@georgeweiler
georgeweiler enabled auto-merge August 4, 2026 13:26
@georgeweiler
georgeweiler added this pull request to the merge queue Aug 4, 2026
Merged via the queue into main with commit 1e1928b Aug 4, 2026
54 checks passed
@georgeweiler
georgeweiler deleted the feat/client-utils-required-ramp-chainid branch August 4, 2026 13:54
georgeweiler added a commit that referenced this pull request Aug 4, 2026
Publish the #9777 breaking change that requires chainId on rampBuy/rampSell ActivityItem variants.

Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Aug 4, 2026
pull Bot pushed a commit to dmrazzy/core that referenced this pull request Aug 4, 2026
## Explanation
Releasing `@metamask/client-utils@2.0.0` to ship the breaking ramp
activity `chainId` change from
MetaMask#9777.

## Changes
- **`@metamask/client-utils` `1.6.0` → `2.0.0`**
- **BREAKING:** `rampBuy` / `rampSell` `ActivityItem` variants require
`chainId`; `mapRampsOrder` returns `null` when no CAIP chain can be
resolved
- Dependency bumps for `@metamask/transaction-controller` and
`@metamask/core-backend` already present under Unreleased

## Client follow-ups
- Extension: MetaMask/metamask-extension#45143
- Mobile: MetaMask/metamask-mobile#34246
(ramps-controller side already shipped in 20.0.0)

## Checklist

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md)
- [x] I've introduced [breaking
changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md)
in this PR and have prepared draft pull requests for clients and
consumer packages to resolve them


Made with [Cursor](https://cursor.com)

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
pull Bot pushed a commit to GoddessofPazkar/metamask-extension that referenced this pull request Aug 5, 2026
## **Description**

Bumps `@metamask/client-utils` to published `^2.0.0` (resolves to
`2.0.0`) from
[MetaMask/core#9777](MetaMask/core#9777).

### Changes
- Replace Yarn `previewBuilds` preview (`1.6.0-preview-*`) with
published `@metamask/client-utils@^2.0.0`
- Required `chainId` on ramp Activity items; `mapRampsOrder` returns
`null` when chainId cannot be resolved
- Keep Activity type re-export simple (no `Exclude` workaround for
ramps)
- Treat a missing token `amount` with `symbol`/`assetId` as `0` in
`getHumanReadableTokenAmount`, since client-utils still omits zero
native `txParams.value` (keeps Activity showing `-0 ETH`)
- Refresh `yarn.lock`, LavaMoat webpack policies, and attributions
- Synced branch with latest `origin/main`

### Out of scope
- Does **not** bump `@metamask/ramps-controller` (remains `^15.0.0`
unless a follow-up requires it)

## **Changelog**

CHANGELOG entry: null

## **Related issues**

Related to: TRAM-3718  
Core: MetaMask/core#9777  
Stacked / related feature work:
MetaMask#45184

## **Manual testing steps**

1. Load a development build of the extension (`yarn start`).
2. Unlock a wallet and open **Activity** on Mainnet.
3. Confirm the activity list loads without type/runtime errors.
4. Send a zero-value transaction (or open a zero-value contract
interaction) and confirm the Activity row shows `-0 ETH` rather than a
blank amount.
5. Confirm `@metamask/client-utils` resolves to `2.0.0` (`yarn why
@metamask/client-utils`).

<!--
## **Screenshots/Recordings**
### **Before**
### **After**
-->

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Dependency upgrade across activity mapping and transaction-controller
with LavaMoat policy changes; localized app logic mitigates zero-value
display regressions but upstream mapper behavior changes could still
affect Activity.
> 
> **Overview**
> Upgrades **`@metamask/client-utils`** from a Yarn-patched **1.2.0** to
published **`^2.0.0`**, dropping the local patch that added extra CAIP
native-asset entries (those chains are expected to ship in the upstream
package). The lockfile pulls in related MetaMask core bumps (e.g.
**`transaction-controller`**, **`core-backend`**,
**`account-tree-controller`**, **`profile-sync-controller`**) and
refreshes **LavaMoat** webpack policies and **attributions**.
> 
> Activity display is adjusted so **`getHumanReadableTokenAmount`**
treats a missing `amount` with token **`symbol`/`assetId`** as **`0`**,
matching client-utils omitting zero native `txParams.value` so rows
still show amounts like **`-0 ETH`**. Tests cover that behavior and the
non-EVM activity selector setup is updated for Solana send
classification.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
dde55ff. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
Co-authored-by: Amitabh Aggarwal <aggarwal.amitabh@gmail.com>
Bigshmow pushed a commit to MetaMask/metamask-extension that referenced this pull request Aug 5, 2026
## **Description**

Bumps `@metamask/client-utils` to published `^2.0.0` (resolves to
`2.0.0`) from
[MetaMask/core#9777](MetaMask/core#9777).

### Changes
- Replace Yarn `previewBuilds` preview (`1.6.0-preview-*`) with
published `@metamask/client-utils@^2.0.0`
- Required `chainId` on ramp Activity items; `mapRampsOrder` returns
`null` when chainId cannot be resolved
- Keep Activity type re-export simple (no `Exclude` workaround for
ramps)
- Treat a missing token `amount` with `symbol`/`assetId` as `0` in
`getHumanReadableTokenAmount`, since client-utils still omits zero
native `txParams.value` (keeps Activity showing `-0 ETH`)
- Refresh `yarn.lock`, LavaMoat webpack policies, and attributions
- Synced branch with latest `origin/main`

### Out of scope
- Does **not** bump `@metamask/ramps-controller` (remains `^15.0.0`
unless a follow-up requires it)

## **Changelog**

CHANGELOG entry: null

## **Related issues**

Related to: TRAM-3718  
Core: MetaMask/core#9777  
Stacked / related feature work:
#45184

## **Manual testing steps**

1. Load a development build of the extension (`yarn start`).
2. Unlock a wallet and open **Activity** on Mainnet.
3. Confirm the activity list loads without type/runtime errors.
4. Send a zero-value transaction (or open a zero-value contract
interaction) and confirm the Activity row shows `-0 ETH` rather than a
blank amount.
5. Confirm `@metamask/client-utils` resolves to `2.0.0` (`yarn why
@metamask/client-utils`).

<!--
## **Screenshots/Recordings**
### **Before**
### **After**
-->

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Dependency upgrade across activity mapping and transaction-controller
with LavaMoat policy changes; localized app logic mitigates zero-value
display regressions but upstream mapper behavior changes could still
affect Activity.
> 
> **Overview**
> Upgrades **`@metamask/client-utils`** from a Yarn-patched **1.2.0** to
published **`^2.0.0`**, dropping the local patch that added extra CAIP
native-asset entries (those chains are expected to ship in the upstream
package). The lockfile pulls in related MetaMask core bumps (e.g.
**`transaction-controller`**, **`core-backend`**,
**`account-tree-controller`**, **`profile-sync-controller`**) and
refreshes **LavaMoat** webpack policies and **attributions**.
> 
> Activity display is adjusted so **`getHumanReadableTokenAmount`**
treats a missing `amount` with token **`symbol`/`assetId`** as **`0`**,
matching client-utils omitting zero native `txParams.value` so rows
still show amounts like **`-0 ETH`**. Tests cover that behavior and the
non-EVM activity selector setup is updated for Solana send
classification.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
dde55ff. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
Co-authored-by: Amitabh Aggarwal <aggarwal.amitabh@gmail.com>
n3ps pushed a commit to MetaMask/metamask-extension that referenced this pull request Aug 6, 2026
## **Description**

Bumps `@metamask/client-utils` to published `^2.0.0` (resolves to
`2.0.0`) from
[MetaMask/core#9777](MetaMask/core#9777).

### Changes
- Replace Yarn `previewBuilds` preview (`1.6.0-preview-*`) with
published `@metamask/client-utils@^2.0.0`
- Required `chainId` on ramp Activity items; `mapRampsOrder` returns
`null` when chainId cannot be resolved
- Keep Activity type re-export simple (no `Exclude` workaround for
ramps)
- Treat a missing token `amount` with `symbol`/`assetId` as `0` in
`getHumanReadableTokenAmount`, since client-utils still omits zero
native `txParams.value` (keeps Activity showing `-0 ETH`)
- Refresh `yarn.lock`, LavaMoat webpack policies, and attributions
- Synced branch with latest `origin/main`

### Out of scope
- Does **not** bump `@metamask/ramps-controller` (remains `^15.0.0`
unless a follow-up requires it)

## **Changelog**

CHANGELOG entry: null

## **Related issues**

Related to: TRAM-3718  
Core: MetaMask/core#9777  
Stacked / related feature work:
#45184

## **Manual testing steps**

1. Load a development build of the extension (`yarn start`).
2. Unlock a wallet and open **Activity** on Mainnet.
3. Confirm the activity list loads without type/runtime errors.
4. Send a zero-value transaction (or open a zero-value contract
interaction) and confirm the Activity row shows `-0 ETH` rather than a
blank amount.
5. Confirm `@metamask/client-utils` resolves to `2.0.0` (`yarn why
@metamask/client-utils`).

<!--
## **Screenshots/Recordings**
### **Before**
### **After**
-->

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Dependency upgrade across activity mapping and transaction-controller
with LavaMoat policy changes; localized app logic mitigates zero-value
display regressions but upstream mapper behavior changes could still
affect Activity.
> 
> **Overview**
> Upgrades **`@metamask/client-utils`** from a Yarn-patched **1.2.0** to
published **`^2.0.0`**, dropping the local patch that added extra CAIP
native-asset entries (those chains are expected to ship in the upstream
package). The lockfile pulls in related MetaMask core bumps (e.g.
**`transaction-controller`**, **`core-backend`**,
**`account-tree-controller`**, **`profile-sync-controller`**) and
refreshes **LavaMoat** webpack policies and **attributions**.
> 
> Activity display is adjusted so **`getHumanReadableTokenAmount`**
treats a missing `amount` with token **`symbol`/`assetId`** as **`0`**,
matching client-utils omitting zero native `txParams.value` so rows
still show amounts like **`-0 ETH`**. Tests cover that behavior and the
non-EVM activity selector setup is updated for Solana send
classification.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
dde55ff. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
Co-authored-by: Amitabh Aggarwal <aggarwal.amitabh@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants